// 登录相关的mock数据
import { mock, Random } from 'mockjs'

// 账号密码登录
export const login = mock({
  'code': 1,
  'msg': '登录成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 手机号登录
export const mobileLogin = mock({
  'code': 1,
  'msg': '登录成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 用户注册
export const register = mock({
  'code': 1,
  'msg': '注册成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 重置密码
export const resetPassword = mock({
  'code': 1,
  'msg': '密码重置成功',
  'data': null
})

// 微信登录
export const wxLogin = mock({
  'code': 1,
  'msg': '登录成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 微信手机号登录
export const wechatMobileLogin = mock({
  'code': 1,
  'msg': '登录成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// APP登录
export const appLogin = mock({
  'code': 1,
  'msg': '登录成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'token': '@guid'
  }
})

// 获取微信OpenID
export const getWechatOpenid = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'openid': '@guid',
    'unionid': '@guid',
    'userinfo': {
      'nickname': '@cname',
      'headimgurl': '@image("100x100", "#4A7BF7", "Avatar")',
      'sex': '@integer(0, 2)',
      'country': '中国',
      'province': '@province',
      'city': '@city'
    }
  }
})

// 获取微信手机号
export const getWechatMobile = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'mobile': '1@string("number", 10)'
  }
})